#ifndef OBJECT_H
#define OBJECT_H

#include "main_inc.h"
#include "clog.h"
#include "SDL.h"
#include "SDL_ttf.h"

#define GO_LIFE         0x00
#define GO_PLAYER1      0x01
#define GO_PLAYER2      0x02
#define GO_ENEMY1       0x03
#define GO_ENEMY2       0x04
#define GO_EAGLE        0x05
#define GO_BULLET       0x06
#define GO_BRICK        0x07
#define GO_WALL         0x08
#define GO_BACK         0x09


#define ANGLES  16


extern SDL_Surface *g_screen;
extern TTF_Font * g_fdebug;

struct Frame
{
    SDL_Surface *surface[ANGLES];
    i32 count;
};


struct Sprite
{
    Sprite()
    {
        ID = 0;
    }

    u32 ID;
    u32 w;
    u32 h;

    vector<Frame> frames;
};

struct Sprite360
{
    Sprite360()
    {
        w = 0;
        h = 0;
    }

    u32 w;
    u32 h;

    SDL_Surface *surface[360];

};


class Object
{
    protected:
        Object();
    public:
        virtual ~Object();

        virtual i32 Render();

        virtual void move(i32 x, i32 y){ px += x; py += y;}
        virtual void setpos(i32 x, i32 y){ px = x; py = y;}

        u32 px;
        u32 py;
        i32 angle;
        u32 type;

        Sprite visual;
        u32 current_frame;


    protected:

        i32 calcAngle(i32 degrees);

    private:
};

#endif // OBJECT_H
